package com.hzy.context;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author huangzhenyu
 * @date 2024/9/10 22:14
 */
public class ApplicationContext implements ConfigurableApplicationContext {

    protected final Logger logger = LoggerFactory.getLogger(getClass());


    protected final PropertyResolver propertyResolver;

    public ApplicationContext(PropertyResolver propertyResolver) {
        this.propertyResolver = propertyResolver;
    }


    public String getProperty(String key) {
        return propertyResolver.getProperty(key);
    }

    public <T> T getProperty(String key, Class<T> targetType) {
        return propertyResolver.getProperty(key, targetType);
    }

    public String getProperty(String key, String defaultValue) {
        return propertyResolver.getProperty(key, defaultValue);
    }

    public <T> T getProperty(String key, Class<T> targetType, T defaultValue) {
        return propertyResolver.getProperty(key, targetType, defaultValue);
    }

}
